package com.bdqn.qnnews.search.convert;

import com.bdqn.qnnews.articel.api.dto.ApArticleDto;
import com.bdqn.qnnews.search.entity.AppInfoArticle;
import com.bdqn.qnnews.search.vo.UserSearchRespVo;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * @author xlzhang
 * @date 2024/1/3 9:33
 */
@Mapper
public interface AppInfoArticleConvert {
    /**
     * 转换类实例
     */
    AppInfoArticleConvert INSTANCE = Mappers.getMapper(AppInfoArticleConvert.class);


    /**
     * dto 转换为 AppInfoArticle
     * @param dto dto对象
     * @return 实体对象
     */
    AppInfoArticle dtoToEntity(ApArticleDto dto);

    /**
     * ApArticle 转换为 dto
     * @param entity 实体
     * @return 实体对象
     */
    UserSearchRespVo entityToVo(AppInfoArticle entity);

}
